Digital data is frequently represented in either integer notation or floating point notation. One advantage of floating point notation is that a larger range of values can be represented in a given number of bit positions using floating notation then can be represented using integer notation. On the other hand, integer notation operations, such as integer addition, subtraction, etc., are often faster and more accurate than floating point operations. As a result of the various advantages for each notation, a number represented in one notation is often converted to the other notation.
Converting from floating point to integer notation, however, may not always be possible because the magnitude of a floating point number may be outside the range of an integer number. For instance, the magnitude of a floating point number may be too large to be represented in the number of bit positions available in the integer field. In which case, the floating point number "saturates" the integer field.
Generally, saturation detection takes place after a floating point number is converted to integer notation. The conversion process can take a comparatively large amount of processing time. For instance, a floating point number may need to be right shifted a particular number of bit positions, and shifting a data field can take a long time. Then, if saturation detection is performed after the data field has been right shifted, additional processing time is expended.
In order to improve data processing performance, a need exists for an improved method and apparatus for saturation detection in floating point to integer conversions.